# -*- coding = utf-8 -*-
# @Time    : 2025/6/25 14:10
# @Author  : 杨明明
# @File    : serializers.py
# @Software: PyCharm

from rest_framework import serializers

from environments.models import Environment
from projects.models import Project


class EnvironmentSerializer(serializers.ModelSerializer):
    project = serializers.PrimaryKeyRelatedField(label='所属项目', help_text='所属项目',
                                                 queryset=Project.objects.all().filter(is_deleted=False))

    class Meta:
        model = Environment
        exclude = ['is_deleted']  # noqa
